package cn.dakaqi.entities;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.Cacheable;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/13.
 * 系统推广的话题
 */

@Entity
@Table(name = "U_SYS_TOPIC")
public class SysTopic extends IdEntity
{

    private static final long serialVersionUID = 3020443803957865756L;
    private String code;//编码
    private String title;//标题
    private String intro;//简介
    private String background;//背景图
    private Date createTime;//发布日期
    private int browses;//浏览量
    private int participants;//参与人数
    private int top;//是否被置顶
    private int goods;//获得的赞数
    private int comments;//评论数
    private String content;
    private String promulgator;//发布人
    private int display;    //是否显示
    private String tags;//本话题对应该的标签
    private Date stopTime;//本话题结束日期（默认一周）

    public SysTopic()
    {

    }

    public String getContent()
    {
        return content;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public Date getStopTime()
    {
        return stopTime;
    }

    public void setStopTime(Date stopTime)
    {
        this.stopTime = stopTime;
    }

    public String getTags()
    {
        return tags;
    }

    public void setTags(String tags)
    {
        this.tags = tags;
    }

    public int getDisplay()
    {
        return display;
    }

    public void setDisplay(int display)
    {
        this.display = display;
    }

    public int getGoods()
    {
        return goods;
    }

    public void setGoods(int goods)
    {
        this.goods = goods;
    }

    public int getComments()
    {
        return comments;
    }

    public void setComments(int comments)
    {
        this.comments = comments;
    }

    public SysTopic(Long id)
    {
        this.id = id;
    }

    public String getCode()
    {
        return code;
    }

    public String getPromulgator()
    {
        return promulgator;
    }

    public void setPromulgator(String promulgator)
    {
        this.promulgator = promulgator;
    }

    public void setCode(String code)
    {
        this.code = code;
    }

    public String getTitle()
    {
        return title;
    }

    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getIntro()
    {
        return intro;
    }

    public void setIntro(String intro)
    {
        this.intro = intro;
    }

    public String getBackground()
    {
        return background;
    }

    public void setBackground(String background)
    {
        this.background = background;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public int getBrowses()
    {
        return browses;
    }

    public void setBrowses(int browses)
    {
        this.browses = browses;
    }

    public int getParticipants()
    {
        return participants;
    }

    public void setParticipants(int participants)
    {
        this.participants = participants;
    }
    @JsonIgnore
    public int getTop()
    {
        return top;
    }

    public void setTop(int top)
    {
        this.top = top;
    }
}
